Auto merge of #2081 - vi:cargo_init, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 24 Jan 2016 18:42:32 +0000 (18:42 +0000)
committerbors <bors@rust-lang.org>
Sun, 24 Jan 2016 18:42:32 +0000 (18:42 +0000)
commitf052d9953f23f55534f497cc70b2b106beefb988
tree43e9ce322c4bca876ede272c3e6177f03d5c64ed
parent1a929a12a76269d54febc9aefdb5bc133d737503
parent800172fbe713670edab4d8c486b2e1e67d3a1038
Auto merge of #2081 - vi:cargo_init, r=alexcrichton

Implement `cargo init` command and appropriate tests ( #21).

Features:
* Working like `cargo new` if there are no files in current directory
* Auto-detection of `--bin`
* Auto-detection of already existing VSC and appending to respecive ignore file
* Appending of appropriate `[lib]` or `[[bin]]` section to `Cargo.toml` in case of some non-standard source locations

Concerns:
* I'm not experienced in Rust + lazy => code looks poorer compared to the rest Cargo code
* The test don't cover 100% of functions
* Project consisting of both binary and library is not handled
* Many deviations from [previously proposed algorithm](https://github.com/rust-lang/cargo/pull/2008#issuecomment-145607870)